package com.carl.controller;

import com.carl.model.Medal;
import com.carl.service.MedalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;


@Controller
@RequestMapping("/medal")
public class MedalController {

    @Autowired
    private MedalService medalService ;

    @ResponseBody
    @RequestMapping("/{id}/info")
    public Medal getMedalInfoById(@PathVariable("id") Long id) {
        return medalService.selectById(id);
    }

    @ResponseBody
    @RequestMapping("/{groupId}/listMedalInfoByGroupId")
    public List<Medal> listMedalInfoByGroupId(@PathVariable("groupId")Long groupId){
        return medalService.listMedalInfoByGroupId(groupId);
    }

}
